mac下的tree命令

  在默认安装安装的mac下没有找到tree命令,找了一下原来有个比较流氓的解决办法:
find . -print | sed -e ‘s;[^/]/;|;g;s;|; |;g’
  这个命令行跑起来类似平常tree的效果,比如:
.
|extra
| |
httpd-autoindex.conf
| |httpd-dav.conf
| |
httpd-default.conf
| |httpd-info.conf
| |
httpd-languages.conf
| |httpd-manual.conf
| |
httpd-mpm.conf
| |httpd-multilang-errordoc.conf
| |
httpd-ssl.conf
| |httpd-userdir.conf
| |
httpd-vhosts.conf
|httpd.conf
|
magic
|mime.types
|
original
| |extra
| | |
httpd-autoindex.conf
| | |httpd-dav.conf
| | |
httpd-default.conf
| | |httpd-info.conf
| | |
httpd-languages.conf
| | |httpd-manual.conf
| | |
httpd-mpm.conf
| | |httpd-multilang-errordoc.conf
| | |
httpd-ssl.conf
| | |httpd-userdir.conf
| | |
httpd-vhosts.conf
| |httpd.conf
|
other
| |bonjour.conf
| |
php5.conf
|____users
  写一个alias到~/.bash_profile里,就更方便了:
alias tree=”find . -print | sed -e ‘s;[^/]
/;|;g;s;|; |;g’”
  觉得文章有用?立即: 和朋友一起 共学习 共进步

×

纯属好玩

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

文章目录
  1. 1. mac下的tree命令
,